<!DOCTYPE html>
<html>
<head>
<title><%= title %></title>
<link rel='stylesheet' href='/stylesheets/style.css' />
</head>
<body>
	<div class="menu">
		<a class="menuItem crrLink" href="/">Home</a> <a class="menuItem"
			href="/gallery">Gallery</a> <a class="menuItem"
			href="/goToUploadImagePage">Upload Image</a>
	</div>
	<h1><%= title %></h1>
	<div class="content_wrp">
		<p>Welcome to <%= title %></p>
		<p class="derc">Lorem ipsum dolor sit amet, reque summo causae no mea, eos ridens adolescens cu. Vis ad dicat putent dolorem, usu discere nonumes no. An vide atqui offendit mei. Tota iisque saperet at quo, latine delicatissimi ius cu. Dictas petentium sapientem in nam.

 Constituam consectetuer ei quo, quem alii sit ut, his facete pertinax ut. Singulis vituperatoribus ei cum. Mei vidisse abhorreant voluptaria an, dicit affert id quo. Eu eum audiam reprimique, vide prompta ei vix. Perfecto repudiandae est eu, quas consulatu est an. Eu reque possim eam.</p>
		<!-- <a href="http://nodejs.org/">Node Js Home Page</a> <br> <br>
		<a href="http://nodejs.org/docs/v0.4.8/api/">API Document</a><br>
		<br> <a href="http://expressjs.com/api.html">Express</a> -->
		<div id= "newsWrp">
			<div id="firstChild" ></div>
		</div>
	</div>
	<img width="800px">
	<script src="/socket.io/socket.io.js"></script>
	<script>
		counter = 0;
		colors = ['green','blue','lightRed','pink'];
		//colors = ['blue'];
		var socket = io.connect('http://localhost');
		socket.on('news', function (data) {
			counter++;
			var cssClass = colors[counter%colors.length];
			var newDiv = document.createElement("div");
			newDiv.className = "newWrp " + cssClass;
			newDiv.innerHTML = "Add  <b class='name'>&nbsp;" + data.name + "&nbsp;</b>  at " + data.uploadDate;
			document.getElementById('firstChild').insertBefore(newDiv, document.getElementById('firstChild').firstChild);
		});
		var videoSocket = io.connect('192.168.0.104:555');
		videoSocket.on('frame', function (data) {
			document.querySelector('img').src = data;
		});
	</script>
	
</body>
</html>
